﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Dune2013
{
    class ActorFactory
    {
        static int tiempoEntreHelicopteros = 0;
        public static void generateHelicoptero(Actor act, Protector pro,int dTime){
            tiempoEntreHelicopteros += dTime;
            if (tiempoEntreHelicopteros > StaticStuff.tiempoEntreHelicopteros)
            {
                tiempoEntreHelicopteros = 0;
                Random r = new Random();
                Helicoptero h = new Helicoptero(act, pro);
                int x=0 , y= 0;
                int arriba = r.Next(0, 10);
                int izquierda = r.Next(0, 10);
                if (arriba%2 == 0)
                {
                    y = r.Next(-200, -50);
                }
                else {
                    y = r.Next(600, 800);
                }
                if (izquierda%2 == 0)
                {
                    x = r.Next(-200, -50);
                }
                else
                {
                    x = r.Next(600, 800);
                }
                h.position = new Vector2(x,y);
                ActorManager.getInstance().actors.Add(h);
            }
        }
    }
}
